#ifndef PARTITIONPARENTWIDGET_H
#define PARTITIONPARENTWIDGET_H

#include <QWidget>
#include <QStyle>
#include <QStyleOption>
#include <QDebug>

#include "partitionwidget.h"
#include "qpainter.h"
#include "common.h"
#include "observer/globalobserver.h"

struct PartitionShowData
{
    Partition partition_data;
    PartitionWidget *partition_widget;
};

class ScreenWidget : public BaseShowWidget
{
    Q_OBJECT
public:
    explicit ScreenWidget(Screen screen, BaseShowWidget *parent = 0);
    void addPartition(Partition one_partition);
    void setAllChildrenLossSelect();
    void setSelectStyle(bool select);
    void selectChild(int partition_id);
    void delPartition(int partition_id);
    QMap<int, PartitionShowData> getMap() {return m_partitions_data;}
    void updateScreen(Screen screen);
    QVector<Partition> getSortPartitionsVector(QMap<int, Partition> map_partitions);
    QVector<PartitionShowData> getSortPartitionWidgetsVector(QMap<int, PartitionShowData> map_partition_widgets);
    void sortPartitionWidgets();

private:
    Screen m_screen;
    QMap<int, PartitionShowData> m_partitions_data;
};

#endif // PARTITIONPARENTWIDGET_H
